package com.arqui.admmon_module.client.core.invalid;

import com.gwtplatform.mvp.client.ViewImpl;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.AbsolutePanel;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;

public class InvalidView extends ViewImpl implements InvalidPresenter.MyView {

	private final Widget widget;
	@UiField Button syntaxB;
	@UiField Button identificationB;
	@UiField Button cardB;
	@UiField AbsolutePanel contentPanel;

	public interface Binder extends UiBinder<Widget, InvalidView> {
	}

	@Inject
	public InvalidView(final Binder binder) {
		widget = binder.createAndBindUi(this);
	}

	@Override
	public Widget asWidget() {
		return widget;
	}
	
	
	public Button getSyntaxB() {
		return syntaxB;
	}

	public void setSyntaxB(Button syntaxB) {
		this.syntaxB = syntaxB;
	}

	public Button getIdentificationB() {
		return identificationB;
	}

	public void setIdentificationB(Button identificationB) {
		this.identificationB = identificationB;
	}

	public Button getCardB() {
		return cardB;
	}

	public void setCardB(Button cardB) {
		this.cardB = cardB;
	}

	public AbsolutePanel getContentPanel() {
		return contentPanel;
	}

	public void setContentPanel(AbsolutePanel contentPanel) {
		this.contentPanel = contentPanel;
	}
	
	@Override
	public void setInSlot(Object slot, Widget content) {
		if(slot == InvalidPresenter.SLOT_content){
			contentPanel.clear();
			
			if(content != null){
				contentPanel.add(content);
			}
		}else{
			super.setInSlot(slot, content);
		}
	}
}